<template>
  <div >
    <div v-for="item of task" :key="item.id" v-if="item.state === tag">
      <div @click="goTask(item.name,item.id)" class="weui-cell cell" >
        <div class="weui-cell__hd textColor">
          <span class="iconMargin">
            <svg class="icon taskIcon" aria-hidden="true">
              <use xlink:href="#iconmokuai1"></use>
            </svg>
          </span>
          {{item.name}}
        </div>
        <div class="weui-cell__bd textColor">
          <label class="weui-label right">
            <svg class="icon iconMargin iconColor" aria-hidden="true">
              <use xlink:href="#iconfuzeren3"></use>
            </svg>
            {{item.leaderName}}
          </label>
        </div>
      </div>
      <el-divider></el-divider>
    </div>
  </div>
</template>

<script>
export default {
  name: 'runTask',
  props: {
    task: []
  },
  data () {
    return {
      tag: this.Run
    }
  },
  methods: {
    goTask (taskName, taskID) {
      sessionStorage.setItem('taskName', taskName)
      sessionStorage.setItem('taskID', taskID)
      this.$router.push('/task')
    }
  }
}
</script>

<style lang="stylus" scoped>
  .right
    float: right
  .iconMargin
    margin-right .5rem
  .textColor
    color #0D0D0D
  .iconColor
    color #88d4ff
  .taskIcon
    color #16b0ff
</style>
